var app = getApp();

function qrcode(e) {
    var t = require("../../../utils/wxqrcode.js").createQrCodeImg(e, {
        size: 200
    });
    return console.log(t), t;
}

Page({
    data: {
        qrcode: !1
    },
    showpos: function() {
        console.log(this.data.packet), wx.openLocation({
            latitude: parseFloat(this.data.packet.addrinfo.club.latitude),
            longitude: parseFloat(this.data.packet.addrinfo.club.longitude),
            name: this.data.packet.addrinfo.club.title,
            address: this.data.packet.addrinfo.club.region + this.data.packet.addrinfo.club.detail
        });
    },
    makePhoneCall: function(e) {
        wx.makePhoneCall({
            phoneNumber: e.currentTarget.dataset.value
        });
    },
    copyText: function(e) {
        wx.setClipboardData({
            data: e.currentTarget.dataset.text,
            success: function(e) {
                wx.getClipboardData({
                    success: function(e) {
                        wx.showToast({
                            title: "复制成功"
                        });
                    }
                });
            }
        });
    },
    copyBill: function(e) {
        wx.setClipboardData({
            data: e.currentTarget.dataset.text,
            success: function(e) {
                wx.getClipboardData({
                    success: function(e) {
                        wx.showToast({
                            title: "复制成功"
                        });
                    }
                });
            }
        });
    },
    onLoad: function(e) {
        console.log(e.id), this.getmodelinfo(e.id);
    },
    getmodelinfo: function(e) {
        var a = this;
        app.util.request({
            url: "entry/wxapp/package",
            showLoading: !1,
            data: {
                op: "getorderinfo",
                id: e
            },
            success: function(e) {
                var t = e.data.data;
                t.express_info ? t.express_info = JSON.parse(t.express_info) : t.express_info = {}, 
                console.log("666_" + t.redeemcode + "#" + t.id), a.setData({
                    packet: t,
                    hex: qrcode("666_" + t.redeemcode + "#" + t.id)
                });
            },
            fail: function(e) {},
            complete: function() {}
        });
    },
    onReady: function() {},
    onShow: function() {
        app.look.navbar(this);
        var e = {};
        e.nor_pos = app.module_url + "resource/wxapp/community/nor-pos.png", e.sq_call = app.module_url + "resource/wxapp/community/sq-call.png", 
        this.setData({
            images: e
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});